﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace HttpAuth.Configuration
{
    public class HttpAuthSection : ConfigurationSection
    {
        [ConfigurationProperty("mode",DefaultValue="None", IsRequired=true)]
        public HttpAuthMode Mode { get { return (HttpAuthMode)this["mode"]; } }

        [ConfigurationProperty("realm", IsRequired = true)]
        public string Realm { get { return this["realm"].ToString(); } }

        [ConfigurationProperty("timeout", DefaultValue = 30)]
        [IntegerValidator]
        public int Timeout { get { return (int)this["mode"]; } }

        [ConfigurationProperty("credentials", IsRequired = true)]
        public HttpAuthCredentials Credentials { get { return (HttpAuthCredentials)this["credentials"]; } }
    }
}
